package com.testfileupload.uploadimg.design.flyweight.define;

import java.util.HashMap;

public class FlywightFactory {
    private static HashMap<String,Flywight> pool = new HashMap<>();

    public static Flywight getFlywight(String key){
        Flywight flywight =null;
        if (pool.containsKey(key)){
            flywight = pool.get(key);
        }else {
            flywight = new ConcreateFlaywight1(key);
            pool.put(key,flywight);
        }
        return flywight;
    }
}
